import { mapGetters } from "vuex";
import { validatenull } from '@/util/validate'
export default function() {
    return {
        data() {
            return {
                currentRoute: ''
            };
        },
        computed: {
            ...mapGetters(["homePage"])
        },
        watch: {
            homePage(val, oldVal) {
                // 收到非当前路由的通知时刷新列表
                if (validatenull(val.schoolCity)) {
                    return;
                } else if (this.$route.fullPath === this.currentRoute) {
                    this.getList(this.page)
                }
            },
        },
        created() {
            this.currentRoute = this.$route.fullPath;
        },
    }
}